package cj.web.yc.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.yc.dao.VideoOrderDAO;
import cj.web.yc.domain.VideoOrder;

@Service
public class VideoOrderService {
	
	@Autowired
    private VideoOrderDAO videoOrderDAO;

	/**
	 * 查询
	 * @param video
	 * @return videoOrderlis;size
	 */
	public Map query(VideoOrder videoOrder){
		Map rep = new HashMap();
		List<VideoOrder> videoOrderlis = videoOrderDAO.query(videoOrder);
		int size = videoOrderDAO.querySize(videoOrder); 
		rep.put("videoOrderlis", videoOrderlis);
		rep.put("size", size);
		return rep;
    }
	
	public VideoOrder queryById(int id){
		VideoOrder obj = videoOrderDAO.queryById(id);
		return obj;
    }
	
	public void create(VideoOrder videoOrder){
		videoOrderDAO.create(videoOrder);
	}
	
	public void update(VideoOrder videoOrder){
		videoOrderDAO.update(videoOrder);
	}
	
	public void deleteById(int id){
		videoOrderDAO.deleteById(id);
	}
}
